<?php
require_once("../lib/func.autoloader.php");
// tables.php
// Tables portal.
// Copyright 2007, Alex McClung
$sc = new SuperConstructor();

// If the user is not logged in, redirect them to the login page
if(false === $sc->getUser()) { header("Location: {$sc->config->LoginPage}"); exit(); }

// Load all the tables in the database that AREN'T SuperConstructor system tables
$sql = new SQL();
$sql->Query("SHOW TABLE STATUS WHERE Name NOT LIKE 'sc_%'");

$tables = array();
while($row = $sql->GetObject())
{
	$tables[] = $row;
}

// Cleanup
unset($sql);

// Assign template variables
$sc->assign_by_ref("tables", $tables);

// TEMPLATE! DISPLAY!
$sc->display("admin/pages/table_editor/index.tpl");
?>